TARGET		= zookeeper_test
SRCS		= $(wildcard *.cpp)
OBJS     	= $(patsubst %.cpp, %.o, $(SRCS))
OBJ_DIR		= obj
CC			= g++
TARGET_OBJS	= $(addprefix $(OBJ_DIR)/, $(OBJS))
DEP_LIBS	= /data/calm/3rd/zookeeper-3.4.3/src/c/.libs/libzookeeper_mt.a -lm -lc -lz -lrt -lpthread
DEP_INCPATH = -I/data/calm/3rd/zookeeper-3.4.3/src/c/src -I/data/calm/3rd/zookeeper-3.4.3/src/c/include -I/data/calm/3rd/zookeeper-3.4.3/src/c/generated

.PHONY : all clean depend

all : depend $(TARGET)

-include .depend

$(TARGET) : $(TARGET_OBJS)
	$(CC) -g -ggdb -Wall -o $@ $^ $(DEP_LIBS)

$(OBJ_DIR)/%.o : %.cpp
	$(CC) -g -ggdb -Wall $(DEP_INCPATH) -c $< -o $@

depend : $(SRCS)
	$(CC) -MM $(PRCSYS_INC) $^ > .depend
	@-(./replace.sh)

clean:
	@-(rm $(OBJ_DIR)/*.o $(TARGET) .depend)
